package net.sppan.base.service;

import net.sppan.base.entity.mgEntity.MgUserAppoint;
import net.sppan.base.service.support.IBaseService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;

/**
 * <p>
 * 用户服务类
 * </p>
 *
 * @author SPPan
 * @since 2016-12-28
 */
public interface IMgUserAppointService extends IBaseService<MgUserAppoint, Integer> {

	/**
	 * 根据用户名查找用户
	 * @param username
	 * @return
	 */
	MgUserAppoint findByUserName(String username);


	MgUserAppoint findByTelephone(String telephone);

	/**
	 * 增加或者修改用户
	 * @param user
	 */
	void saveOrUpdate(MgUserAppoint user);

	long countAllByAppointmentTime(String appointmentTime);

	/**
	 * 根据关键字获取分页
	 * @param searchText
	 * @param pageRequest
	 * @return
	 */
	Page<MgUserAppoint> findAllByLike(String searchText, PageRequest pageRequest);


	Object[] queryAppointtimeNum();

	MgUserAppoint findByTelephoneAndAppointmentTimeAndTeacherName(String telephone,String appointmentTime,String teacherName);
}
